{% extends "./inc/base.html" %}
{% block content %}
<section class="vbox">
    <header class="header bg-light dk">
        <p>{{controller.meta_title}}</p>
    </header>
    <section class="scrollable wrapper">

        <section class="panel panel-default">
            <div class="search-form">
                <div class="row wrapper">

                    <div class="col-sm-3">
                        <div class="input-group pull-right">
                            <span class="input-group-addon">买方/委托方公司</span>
                            <input type="text" class="input-sm form-control" name="xu_gsmc" placeholder=""
                                value="{{controller.get('xu_gsmc')}}">
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group pull-right">
                            <span class="input-group-addon">买方/委托方电话</span>
                            <input type="text" class="input-sm form-control" name="xu_mobile" placeholder=""
                                value="{{controller.get('xu_mobile')}}">
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group pull-right">
                            <span class="input-group-addon">卖方/承接方公司</span>
                            <input type="text" class="input-sm form-control" name="gong_gsmc" placeholder=""
                                value="{{controller.get('gong_gsmc')}}">
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group pull-right ">
                            <span class="input-group-addon">卖方/承接方电话</span>
                            <input type="text" class="input-sm form-control" name="gong_mobile" placeholder=""
                                value="{{controller.get('gong_mobile')}}">
                        </div>
                    </div>
                </div>
                <div class="row" style="padding:0 15px 15px;">

                    <div class="col-sm-3">
                        <div class="input-group pull-right ">
                            <span class="input-group-addon">订单编号</span>
                            <input type="text" class="input-sm form-control" name="order_no" placeholder=""
                                value="{{controller.get('order_no')}}">
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <div class="input-group pull-right ">
                            <span class="input-group-addon">商品类别</span>
                            <input type="text" class="input-sm form-control" name="shangpingleibie" placeholder=""
                                value="{{controller.get('shangpingleibie')}}">
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <span class="input-group-btn">
                            <button style="width: 100%;" class="btn  btn-default" type="button" id="search"
                                url="/{{controller.active}}{%if status %}?status=2{% endif %}">搜索</button>
                        </span>
                    </div>
                    <div class="col-sm-3">
                        <span class="input-group-btn">
                            <button style="width: 100%;" class="btn  btn-default" type="button" id="exportCSV"
                                url="/{{controller.active}}export">导出</button>
                        </span>
                    </div>

                </div>
            </div>
            </div>
            <div class="table-responsive" style="position: relative;overflow: auto;width: 100%;">
                <table class="table table-hover b-t b-light" style="table-layout: fixed;">
                    <thead>
                        <tr>
                            <th style="width:60px;">序号</th>
                            <th style="width:120px;">订单编号</th>
                            <th style="width:100px;">下单方类型</th>
                            <th style="width:150px;">下单方姓名</th>
                            <th style="width:200px;">下单方公司名称</th>
                            <th style="width:120px;">商品类别</th>
                            <th style="width:150px;">所在地区</th>
                            <th style="width:100px;">信息类型</th>
                            <th style="width:100px;">信息通道</th>
                            <th style="width:150px;">买方/委托方电话</th>
                            <th style="width:150px;">买方/委托方姓名</th>
                            <th style="width:200px;">买方/委托方公司</th>
                            <th style="width:150px;">卖方/承接方电话</th>
                            <th style="width:150px;">卖方/承接方姓名</th>
                            <th style="width:200px;">卖方/承接方公司</th>
                            <th style="width:150px;">下单时间</th>
                            {# <th style="width:150px;">审核时间</th>
                                        <th style="width:100px;">审核结果</th>
                                        <th style="width:100px;">退回类型</th> #}
                            <th style="width:100px;">存续状态</th>
                            <th style="width:100px;">确认状态</th>
                            <th style="width:150px;">复核时间</th>
                            <th style="width:100px;">复核结果</th>
                            <th style="width:100px;">终止类型</th>
                            <th style="width:150px;">问题订单认定方式</th>
                            <th style="width:100px;">订单详情</th>
                            {# <th style="width:100px;">备注</th> #}
                        </tr>
                    </thead>
                    <tbody>
                        {% for item in list %}
                        <tr>
                            <td class="text-center">{{loop.index}}</td>
                            <td><a href="/admin/order/see/?id={{item.id}}" class="text-info"
                                    data-toggle="ajaxModal">{{item.order_no}}</a></td>
                            <td>{{item.order_userinfo.groupid|get_groupname}}</td>
                            <td>{% if item.order_userid==item.xuid%}{{item.xu_username}}{%else%}{{item.gong_username}}{%endif%}
                            </td>
                            <td>{% if item.order_userid==item.xuid%}{{item.xu_gsmc}}{%else%}{{item.gong_gsmc}}{%endif%}
                            </td>
                            <td>{{item.shangpingleibie}}</td>
                            <td>{{item.diqu}}</td>
                            <td>{{item.yewuleixing|get_gongxutype}}</td>
                            <td>{{item.info_channel|get_channelname}}</td>
                            <td>{{item.xu_mobile}}</td>
                            <td>{{item.xu_username}}</td>
                            <td>{{item.xu_gsmc}}</td>
                            <td>{{item.gong_mobile}}</td>
                            <td>{{item.gong_username}}</td>
                            <td>{{item.gong_gsmc}}</td>
                            <td>{{item.chuangjianshijian}}</td>
                            {# <td></td>
                                        <td></td>
                                        <td></td> #}
                            <td>{% if item.order_userid==item.xuid %}{{item.xuqueren|get_cunxuname}}{%else%}{{item.gongqueren|get_cunxuname}}{%endif%}
                            </td>
                            <td>{% if item.order_userid==item.xuid %}{{item.gongqueren|get_querenname}}{%else%}{{item.xuqueren|get_querenname}}{%endif%}
                            </td>
                            <td>{% if item.review_remark %}{{item.review_remark.remark_time|moment('YYYY-MM-DD HH:mm:ss')}}{%endif%}
                            </td>
                            <td>{% if item.review_remark %}{%set operation_value = item.review_remark.operation_value|strToJson%}{{operation_value.status|get_orderstatus}}{%endif%}</td>
                            <td>{{item.problem_type}}</td>
                            <td>{% if item.decision_problem_node %}{{item.decision_problem_node|get_remark_type}}{%endif%}
                            </td>
                            <td class="text-center">
                                <a href="/admin/order/see/?id={{item.id}}" class="text-info"
                                    data-toggle="ajaxModal">查看</a>
                            </td>
                        </tr>
                        {% else %}
                        <tr>
                            <td colspan="23">
                                <div class="alert alert-warning alert-block">
                                    <button data-dismiss="alert" class="close" type="button">×</button>
                                    <p>暂无数据</p>
                                </div>
                            </td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">


                    <div class="col-sm-12 text-right text-center-xs">
                        {{pagerData | safe}}
                    </div>
                </div>
            </footer>
        </section>
    </section>
</section>

{% endblock %}
{% block script%}
<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>
{% endblock%}